<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>添加人员档案</title>
		<link href="themes/css/ui.common.css" rel="stylesheet"
			type="text/css" />
		<link href="themes/css/ui.child.css" rel="stylesheet"
			type="text/css" />
		<link href="themes/css/ui.tips.css" rel="stylesheet"
			type="text/css" />
		<link href="style/jquery_ui/jquery-ui-1.8.custom.css"
			rel="stylesheet" type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css" />
		<link href="style/mailSender.css" rel="stylesheet"
			type="text/css" />
		<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
		<script src="Scripts/jquery.json-2.2.min.js"
			type="text/javascript"></script>
		<script src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>
		<script src="Scripts/ui.default.js " type="text/javascript"
			charset="UTF-8"></script>
		<script src="Scripts/ui.admincp.js" type="text/javascript"
			charset="UTF-8"></script>
		<script src="HtmlEditor/kindeditor.js" type="text/javascript"></script>
		<script src="Scripts/HtmEditorCreator.js" type="text/javascript"></script>
		<style type="text/css">
.text-align-right {
	text-align: right;
	padding-right: 2px;
	font-weight: bolder;
}

.text-control-left {
	text-align: left;
	width: 200px;
}

.control-width-180 {
	width: 180px;
}

.control-width-80 {
	width: 80px;
}

.input-control {
	border: 0;
	height: 24px;
	padding: 2px;
}

.td-width-100 {
	text-align: left;
	width: 100px;
}

.td-width-100 {
	width: 120px;
}

.style1 {
	
}

.input-big-text {
	width: 635px;
	height: 100px;
}

td {
	padding: 2px;
}
</style>
	<SCRIPT type="text/javascript">
	$(function () {
           switcher();
           if($.trim($("#txt_staffId").val()) != ''){
           		$("#exportButton").attr("disabled",false);
           }
    });
	function switcher() {
	$("#sectionSelector").change( function() {
		var sectionId = $(this).val();
		$.post("archivesInfo!queryStaffBySection.action", {
			"sectionId" :sectionId
		}, function(data) {
			if(data != '')
			//对应的物资信息添加到select中
			$("#staffSelector").html("").append(data);
			else
			$("#staffSelector").html("").append("<option value=\"\">-请先选择部门-</option>" );
			});
		},

		"html");
	}
	
	function clearPostSelector(){
		$("#staffSelector").html("").append("<option value=\"\">-请先选择部门-</option>" );
	}
	
	function changeStaffSelector(){
		var staffId = $('#staffSelector').val();
		location = "archivesInfo!queryByManager.action?staffId="+staffId;
	}
	
	function exportStaff(){
		var staffId = $('#txt_staffId').val();
		location = "archivesInfo!export.action?staffId="+staffId;
	}
	</SCRIPT>
	</head>
	<body>
		<div class="PageChild_Title">
			<img src="themes/images/default/icons/archives.png" class="PageChild_Tbtnpic" />
			<span class="PageChild_separate"></span>
			<span class="PageChild_TbtnText"><h2>查看人员档案</h2></span>
			<span class="PageChild_separate"></span>
			<div id="marker" class="red-tips">
			</div>
			<div class="clear">
			</div>
		</div>
		&nbsp;
		<div align="center">
		<table>
		<tr>
			<td class="text-align-right" style="width: 40px;">部门:</td>
			<td><s:select list="sectionList" listKey="sectionId" listValue="sectionName" headerKey="" headerValue="-请选择-" id="sectionSelector" name="sectionId" theme="simple" cssClass="control-width-40 clearable" cssStyle="width: 152px; height: 26px" value="sectionId"></s:select></td>
			<td class="text-align-right" style="width: 40px;">人员:</td>
			<td><s:select list="#{'':'-请先选择部门-'}" name="staffId" id="staffSelector" theme="simple" cssClass="control-width-40 clearable input-control" cssStyle="width: 152px; height: 26px" onchange="changeStaffSelector();"></s:select></td>
			<td>
				<input id="exportButton" type="button" class="o-btn" value="导出" disabled="true" onclick="exportStaff();"/>
			</td>
		</tr>
		</table>
		</div>
		<br/>
		<table style="border: 1px solid gray; padding: 1px;" border="0"
			cellpadding="0" cellspacing="0" align="center">
			<tr>
				<td>
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td colspan="4" align="center">
								<input id="txt_staffId" type="hidden" value="${staffInfo.staffId}" />
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								学号:
							</td>
							<td class="style1">
								<label>${staffInfo.staffNo}</label>
							</td>
							<td class="text-align-right">
								档案编号:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.archiveNo}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right" style="width: 80px;">
								&nbsp;姓名:
							</td>
							<td style="width: 100px" valign="middle" class="style1">
								<label>${staffInfo.archiveInfo.staffName}</label>
							</td>
							<td class="text-align-right" style="width: 80px;">
								&nbsp;性别:
							</td>
							<td style="width: 220px" class="style1">
								<label>${staffInfo.archiveInfo.gender}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								&nbsp;年龄:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.age}</label>
							</td>
							<td class="text-align-right">
								&nbsp;生日:
							</td>
							<td class="style1">
								<label>${birthday}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								&nbsp; 政治面貌:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.politician}</label>
							</td>
							<td class="text-align-right">
								年级:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.grade}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								专业:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.majorInfo.majorName}</label>
							</td>
							<td class="text-align-right">
								&nbsp;班级:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.classNo}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								&nbsp; 联系电话:
							</td>
							<td>
								<label>${staffInfo.archiveInfo.telphone}</label>
							</td>
							<td class="text-align-right">
								人员邮箱:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.mailInfo.mail}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right">
								&nbsp;寝室地址:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.dormitory}</label>
							</td>
							<td class="text-align-right">
								&nbsp;所在部门:
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.postInfo.sectionInfo.sectionName}</label>
							</td>
						</tr>
						<tr>
							<td class="text-align-right"> 
								&nbsp;所在职位: 
							</td>
							<td class="style1">
								<label>${staffInfo.archiveInfo.postInfo.postName}</label>
							</td>
							<td class="text-align-right">&nbsp; 是否在职: 
							</td>
							<td class="style1">
								<s:if test="staffInfo.states == 1">在职</s:if>
								<s:if test="staffInfo.states == 0">停职</s:if>
								<s:if test="staffInfo.states == -1">离职</s:if>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="center">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
				<td>
					<table width="300">
						<tr>
							<td style="width: 200px;" align="center">
								<div style="border: 1px solid gray; padding: 5px; width: 160px;">
									<img src="getPhoto.action?avatarId=${avatarId}&gender=${gender}" width="140" height="180"/>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<table width="100%">
							<tr>
							<td class="text-align-right" valign="top" width="60">
								奖励:
							</td>
							<td class="style1" valign="top" align="left" colspan="4">
								<div class="PageChild_List">
									<table width="100%" border="0" cellspacing="0"
										style="text-align: left">
										<tbody class="PageChild_List_head">
											<tr>
												<td width="120">
													时间
												</td>
												<td>
													奖励内容
												</td>
												<td width="100">
													奖励类别
												</td>
											</tr>
										</tbody>
										<tbody class="PageChild_List_main" style="text-align: left">
										<s:if test="rewardList != null && rewardList.size != 0">
											<s:iterator value="rewardList" var="item">
												<tr class='td_no_bord'>
													<td>
														<span>${item.strCreateTime}</span>&nbsp;
													</td>
													<td>
														<span>${item.contents}</span>&nbsp;
													</td>
													<td>
														<span>${item.rpCategory.categoryName}</span>&nbsp;
													</td>
												</tr>
											</s:iterator>
										</s:if>
										<s:else><tr><td colspan="3"><span>无记录</span></td></tr></s:else>
										</tbody>
									</table>
								</div>
							</td>
						</tr>
						<tr>
							<td class="text-align-right" valign="top">
								惩罚:
							</td>
							<td class="style1" valign="top" align="left" colspan="4">
								<div class="PageChild_List">
									<table width="100%" border="0" cellspacing="0"
										style="text-align: left">
										<tbody class="PageChild_List_head">
											<tr>
												<td width="120">
													时间
												</td>
												<td>
													惩罚内容
												</td>
												<td width="100">
													惩罚类别
												</td>
											</tr>
										</tbody>
										<tbody class="PageChild_List_main" style="text-align: left">
										<s:if test="punishList != null && punishList.size != 0">
											<s:iterator value="punishList" var="item">
												<tr class='td_no_bord'>
													<td>
														<span>${item.strCreateTime}</span>&nbsp;
													</td>
													<td>
														<span>${item.contents}</span>&nbsp;
													</td>
													<td>
														<span>${item.rpCategory.categoryName}</span>&nbsp;
													</td>
												</tr>
											</s:iterator>
											</s:if>
											<s:else><tr><td colspan="3"><span>无记录</span></td></tr></s:else>
										</tbody>
									</table>
								</div>
							</td>
						</tr>
						<tr>
							<td class="text-align-right" valign="top">
								操作记录:
							</td>
							<td class="style1" valign="top" align="left" colspan="4">
								<div class="PageChild_List">
									<table width="100%" border="0" cellspacing="0"
										style="text-align: left">
										<tbody class="PageChild_List_head">
											<tr>
												<td width="120">
													时间
												</td>
												<td>
													操作内容
												</td>
												<td width="100">
													操作类别
												</td>
											</tr>
										</tbody>
										<tbody class="PageChild_List_main" style="text-align: left">
										<s:if test="recordList != null && recordList.size != 0">
											<s:iterator value="recordList" var="item">
												<tr class='td_no_bord'>

													<td>
														<span>${item.strCreateTime}</span>&nbsp;
													</td>
													<td>
														<span>${item.messages}</span>&nbsp;
													</td>
													<td>
														<span>${item.recordCategory.categoryName}</span>&nbsp;
													</td>
												</tr>
											</s:iterator>
											</s:if>
											<s:else><tr><td colspan="3"><span>无记录</span></td></tr></s:else>
										</tbody>
									</table>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="3" align="center">
								&nbsp;
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
